package com.imay.live.view.dialog;

import android.os.Bundle;

import com.imay.base.fragment.BaseDialogFragment;

public abstract class CommonDialogFragment extends BaseDialogFragment {

    protected static final String EXTRA_NAME_TITLE = "title";
    protected static final String EXTRA_NAME_MESSAGE = "message";
    protected static final String EXTRA_NAME_NEGATIVE = "negative";
    protected static final String EXTRA_NAME_POSITIVE = "positive";

    protected String mTitle;
    protected String mMessage;
    protected String mNegative;
    protected String mPositive;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Bundle bundle = getArguments();

        if (bundle != null) {
            mTitle = bundle.getString(EXTRA_NAME_TITLE);
            mMessage = bundle.getString(EXTRA_NAME_MESSAGE);
            mPositive = bundle.getString(EXTRA_NAME_POSITIVE);
            mNegative = bundle.getString(EXTRA_NAME_NEGATIVE);
        }
    }

    protected static Bundle getBundle(String title, String message, String positive, String negative) {
        Bundle bundle = new Bundle();
        bundle.putString(EXTRA_NAME_TITLE, title);
        bundle.putString(EXTRA_NAME_MESSAGE, message);
        bundle.putString(EXTRA_NAME_POSITIVE, positive);
        bundle.putString(EXTRA_NAME_NEGATIVE, negative);
        return bundle;
    }

}
